Repository navigation
feat(everything-dev,every-plugin,host,ui): the @/ui facade renders server-side; the expose ships primitives only (#1260) - #1264
Open
efizzybot wants to merge 2 commits into
Conversation
…rver-side; the expose ships primitives only (issue #1260) SSR (ADR 0064, closes spike-verdict 077 item 2): the host compose threads a session-bound expose resolver through constructTree into the generated routeConfig loaders, which register it — via a dynamically imported, import-free stash module (everything-dev/ui/ssr-registry) — into the caller's own module graph before route modules evaluate. Facade components resolve through the SAME container generation the tree was minted from (integrity-verified, generation-keyed caches); the render-null-on-server gate is gone, real markup streams, and React selective hydration keeps server HTML visible until the browser expose lands. Any composed source's exposes resolve server-side, not just the core's. The core ui's node container ships the ./components expose; the dev loopback plane rewrites the container's stamped publicPath to its own origin (a same-named web chunk otherwise shadows the node bytes for routeConfig, which ships in both environments). Expose (ADR 0059 §4 generic-only, per the #1260 decision): ./components points at ui/src/components/expose.ts — shadcn primitives only; the app-flavored components (ConfirmDialog, Markdown, stepper, info rows, local-date, UnderConstruction) and the error surface stay source-owned in the core barrel, which re-exports the expose unchanged for @/components. The scaffold prune protects the expose file (a child is its own provider and bos mf check gates it). Preload: SSR documents preload the expose's static dependency chunks (assets.js.sync from the core's mf-manifest — the async list is the app's whole dynamic graph and is never a preload source), attached to the core remote in the compose payload; dev-local sources derive the manifest URL from the entry. Best-effort: no manifest, no hints. Discovery: the core's manifest carries the expose surface (components: [{ expose, exports }]). Tests: unit (stash, SSR markup via renderToReadableStream, chunk-URL parser, expose-surface guard), manifest-generator/loader shapes, browser spec (SSR markup pin, preload hints, one-request-per-session). KNOWN: issue #1259 (auth slot double-opens its PGlite dir) reproduces intermittently in dev on this tree AND on main — the browser regression runner refuses stacks with failed plugins, so the spec runs there once #1259 lands. Everything else verified against a live dev session: /docs serves the remote Input's real markup (data-slot="input") with 13 facade preload links.
The SSR/expose commit re-expanded the capability-exports paragraph past the validator's 500-line budget (503 counted). Fold the toast-copy example into prose and drop the wrapped ensureQueryData call to one line — the facade guidance keeps its substance.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1260. Stacked on #1258 (base is its branch).
What landed
SSR for facade components (spike-verdict 077 item 2, ADR 0064): the host compose threads a session-bound expose resolver through
constructTreeinto the generatedrouteConfigloaders, which register it — via a dynamically imported, import-free stash module (everything-dev/ui/ssr-registry) — into the caller's own module graph before route modules evaluate. Facade components resolve through the SAME container generation the tree was minted from (integrity-verified, generation-keyed caches). The render-null-on-server gate is gone: real markup streams, and React selective hydration keeps server HTML visible until the browser expose lands — no flash, no mismatch. Any composed source's exposes resolve server-side (the auth profile section remotes get it for free).Expose slimmed to shadcn primitives (the #1260 decision):
./componentspoints atui/src/components/expose.ts— everything underui/, nothing else. App-flavored components (ConfirmDialog, Markdown, stepper, info rows, local-date, UnderConstruction) and the error surface stay source-owned in the core barrel;@/componentsis unchanged (it re-exports the expose plus the app-flavored files). The scaffold prune protects the expose file (a child is its own provider;bos mf checkgates it). The@/uisyntax is untouched — the generator maps symbols.Preload: SSR documents preload the expose's STATIC dependency chunks (
assets.js.syncfrom the core's mf-manifest — the async list is the app's whole dynamic graph and is never a source), attached to the core remote in the compose payload; dev-local sources derive the manifest URL from the entry. Best-effort: no manifest, no hints.Discovery: the core's manifest carries the expose surface (
components: [{ expose, exports }]).Dev loopback fix (required by the above): the loopback plane rewrites the SSR container entry's stamped publicPath to its own origin — served unmodified, a container with a real routeConfig chunk fetches it from the plugin's web dev server, where a same-named web chunk shadows the node bytes (
self is not defined).Verification
renderToReadableStream), chunk-URL parser against the real mf-manifest shape, expose-surface guard, manifest-generator/loader shapes, public-surface snapshots./docsserves 200 with the remote Input's real markup (data-slot="input") + 13 facade preload links; the browser check shows one unique expose URL per session with clean facade hydration.ui-facade.spec.ts) — SSR markup pin, preload hints, one-request-per-session. It runs in the regression stack once dev: the auth slot double-opens the auth PGlite data dir — the host marks it permanent and the composed SSR plane 500s on every route #1259 stops the auth slot from double-opening its PGlite dir (reproduces on main too; partially fixed by feat(host): a plugin ui slot's compose failure degrades that slot only (#1259 done-when 3) #1263).Numbers (dev build, ui/dist)